package com.sc.portal.controller;

import com.sc.portal.service.ContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * Created by sc on 2017/10/17.
 */
@Controller
public class IndexController {

    @Autowired
    private ContentService contentService;

    @RequestMapping("/")
    public String getindex(Model model){
        //取广告内容
        String json = contentService.getAd1List();
        model.addAttribute("ad1",json);
        return "index";
    }
}
